<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>分享设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__LAYUI__/css/layui.css" media="all">
    <link rel="stylesheet" href="__ADMIN__/style/admin.css" media="all">
    <style>
        *{font-weight: 300;}

        main {padding: 15px;background-color: #ffffff;}
        main > blockquote {vertical-align: middle;overflow: hidden;color: #666;line-height: 60px;}
        main > blockquote > div > .layui-icon {font-size: 60px;color: #666;line-height: 60px;}

        .layui-form-pane .layui-form-text{padding: 0 10px;}
        .layui-form-pane .layui-form-label{background: none !important;padding-left: 2px;border: 0;color:#000;}
        .layui-form-pane .layui-form-text input, .layui-form-pane .layui-form-text textarea{border-radius: 3px !important;}
    </style>

</head>
<body>

<main>

    <blockquote class="layui-elem-quote layui-quote-nm">
        <div style="float: left;"><i class="layui-icon layui-icon-username"></i></div>
	    <div style="float: left;line-height: 30px;padding: 3px 3px 3px 10px;">
		    用户名：{$user.username}
		    <a class="logout" style="color: red;font-size: 80%;margin-left: 10px;" href="javascript:;">安全退出</a>
		    <br>
		    到期日期：{:date('Y-m-d', $user.end_time)}
	    </div>
    </blockquote>

	<div class="layui-btn-container" style="margin: 10px 0;">
		<a href="{:url('user/index/index')}" class="layui-btn layui-btn-primary layui-border-blue"><i class="layui-icon layui-icon-left"></i>返回首页</a>
		<a href="{:url('user/index/shareinfo')}" class="layui-btn layui-bg-blue"><i class="layui-icon layui-icon-share"></i>设置</a>
		{if $user.admin == 3}
		<a href="{:url('user/user/index')}" class="layui-btn layui-bg-blue"><i class="layui-icon layui-icon-user"></i>用户</a>
		{/if}
	</div>

    <div class="layui-card-body">

        <blockquote class="layui-elem-quote layui-quote-nm">
            <p>分享设置</p>
        </blockquote>

        <form class="layui-form layui-form-pane" method="post" style="margin-top: 10px;">

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">聊天间隔时间</label>
                <div class="layui-input-block">
                    <input type="text" name="wechat_time" value="{$data.wechat_time}" placeholder="聊天间隔时间" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分享背景图（先展示）（推荐群、好友）</label>
                <div class="layui-input-block">
                    <input type="text" name="share_bg" value="{$data.share_bg}" placeholder="分享背景图（先展示）（推荐群、好友）" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分享背景图（后更改）（推荐朋友圈）</label>
                <div class="layui-input-block">
                    <input type="text" name="share_bg2" value="{$data.share_bg2}" placeholder="分享背景图（后更改）（推荐朋友圈）" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享多少次后更换背景图</label>
		        <div class="layui-input-block">
			        <select name="huan_bg_num" lay-verify="required">
				        <option value="1"{$data.huan_bg_num == 1 ? ' selected' : ''}>✓ 1次</option>
				        <option value="2"{$data.huan_bg_num == 2 ? ' selected' : ''}>✓ 2次</option>
				        <option value="3"{$data.huan_bg_num == 3 ? ' selected' : ''}>✓ 3次</option>
				        <option value="4"{$data.huan_bg_num == 4 ? ' selected' : ''}>✓ 4次</option>
				        <option value="5"{$data.huan_bg_num == 5 ? ' selected' : ''}>✓ 5次</option>
			        </select>
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">先分享到群？先圈？</label>
		        <div class="layui-input-block">
			        <input type="radio" name="share_xian_who" value="1" title="先分享到群"{$data.share_xian_who == 1 ? ' checked' : ''}>
			        <input type="radio" name="share_xian_who" value="2" title="先分享到朋友圈"{$data.share_xian_who == 2 ? ' checked' : ''}>
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享到群次数</label>
		        <div class="layui-input-block">
			        <select name="share_qun_num" lay-verify="required">
				        <option value="1"{$data.share_qun_num == 1 ? ' selected' : ''}>✓ 1次</option>
				        <option value="2"{$data.share_qun_num == 2 ? ' selected' : ''}>✓ 2次</option>
				        <option value="3"{$data.share_qun_num == 3 ? ' selected' : ''}>✓ 3次</option>
				        <option value="4"{$data.share_qun_num == 4 ? ' selected' : ''}>✓ 4次</option>
				        <option value="5"{$data.share_qun_num == 5 ? ' selected' : ''}>✓ 5次</option>
			        </select>
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享到朋友圈次数</label>
		        <div class="layui-input-block">
			        <select name="share_quan_num" lay-verify="required">
				        <option value="1"{$data.share_quan_num == 1 ? ' selected' : ''}>✓ 1次</option>
				        <option value="2"{$data.share_quan_num == 2 ? ' selected' : ''}>✓ 2次</option>
				        <option value="3"{$data.share_quan_num == 3 ? ' selected' : ''}>✓ 3次</option>
				        <option value="4"{$data.share_quan_num == 4 ? ' selected' : ''}>✓ 4次</option>
				        <option value="5"{$data.share_quan_num == 5 ? ' selected' : ''}>✓ 5次</option>
			        </select>
		        </div>
	        </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分享触发提示</label>
                <div class="layui-input-block">
                    <input type="text" name="share_alert_0" value="{$data.share_alert_0}" placeholder="分享触发提示" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分享提示1</label>
                <div class="layui-input-block">
                    <input type="text" name="share_alert_1" value="{$data.share_alert_1}" placeholder="分享提示1" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享提示2</label>
		        <div class="layui-input-block">
			        <input type="text" name="share_alert_2" value="{$data.share_alert_2}" placeholder="分享提示2" required lay-verify="required" autocomplete="off" class="layui-input">
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享提示3</label>
		        <div class="layui-input-block">
			        <input type="text" name="share_alert_3" value="{$data.share_alert_3}" placeholder="分享提示3" required lay-verify="required" autocomplete="off" class="layui-input">
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享提示4</label>
		        <div class="layui-input-block">
			        <input type="text" name="share_alert_4" value="{$data.share_alert_4}" placeholder="分享提示4" required lay-verify="required" autocomplete="off" class="layui-input">
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享提示5</label>
		        <div class="layui-input-block">
			        <input type="text" name="share_alert_5" value="{$data.share_alert_5}" placeholder="分享提示5" required lay-verify="required" autocomplete="off" class="layui-input">
		        </div>
	        </div>

	        <div class="layui-form-item layui-form-text">
		        <label class="layui-form-label">分享提示6</label>
		        <div class="layui-input-block">
			        <input type="text" name="share_alert_6" value="{$data.share_alert_6}" placeholder="分享提示6" required lay-verify="required" autocomplete="off" class="layui-input">
		        </div>
	        </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分享完成二维码提示</label>
                <div class="layui-input-block">
                    <input type="text" name="share_end_msg" value="{$data.share_end_msg}" placeholder="分享完成二维码提示" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>



            <div class="layui-form-item">
                <div class="layui-input-block layui-btn-container" style="margin: 10px 0;text-align:center;">
	                <button class="layui-btn" lay-submit lay-filter="create"><i class="layui-icon layui-icon-ok"></i>立即保存</button>
                    <a href="{:url('user/index/index')}" class="layui-btn layui-btn-primary layui-border-blue"><i class="layui-icon layui-icon-left"></i>返回首页</a>
                </div>
            </div>
        </form>

    </div>

</main>

<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<!--<script src="https://cdn.jsdelivr.net/npm/jquery@2.1.4/dist/jquery.min.js" type="text/javascript" charset="utf-8"></script>-->
<!--<script>window.jQuery || document.write('<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"><\/script>')</script>-->
<script src="__LAYUI__/layui.js" type="text/javascript"></script>
<script src="__STATIC__/js/public.js" type="text/javascript"></script>

<script>
    layui.use(['form'], function(){
        var form = layui.form;

        form.on('radio(share_end_type)', function (data) {
            if ( data.value == 1 ){
                $('.share_end_type_1').show();
                $('.share_end_type_2').hide();
            } else {
                $('.share_end_type_2').show();
                $('.share_end_type_1').hide();
            }
        });

        form.on('radio(touxiang)', function (data) {
            var touxiang = data.value;
            if ( touxiang == 0 ){
                $('#shangchuantouxiang').show();
            } else {
                $('#shangchuantouxiang').hide();
                $('#shangchuantouxiang .upload-input').val(touxiang);
                $('#shangchuantouxiang .upload-img').attr('src', touxiang);
                layer.msg('查看图片<br><img src="'+touxiang+'" width="100"><br>2秒后自动关闭', {time:2000});
            }
        });

        form.on('select(muban)', function (data){
            var zidingyi = data.value;
            if ( zidingyi == '0' ){
                //点选了 自定义模板
                $('#zidingyi').show();
            }else{
                $('#zidingyi').hide();
            }
        });

        form.on('select(haibaomuban)', function (data){
            if ( data.value == 1 ){
                //点选了 分享海报模板
                $('#wechat_time').show();
            }else{
                $('#wechat_time').hide();
            }
        });

    });

</script>
</body>
</html>
